#ifndef __LOGGER_H__
#define __LOGGER_H__

#include <E32STD.H>
#ifdef __WINS__
//#define LogEnabled
#else
//#define LogEnabled
#endif
///////////////////////////////////////////////////////////////////////////////
//Writes events log to a file

#ifdef LogEnabled
	class Logger
	{
	public:
		static void Clear();
		static void AddLineF(TRefByValue<const TDesC8> aFormat, ...);
		static void AddLineF(TRefByValue<const TDesC8> aFormat, VA_LIST aList);
		static void AddLineF(TRefByValue<const TDesC> aFormat, ...);
		static void AddLineF(TRefByValue<const TDesC> aFormat, VA_LIST aList);
		static void EnterFunction(const TDesC8& aFuncName);
		static void LeaveFunction(const TDesC8& aFuncName);
	//	
	};

	#define LOG_CLEAR Logger::Clear();
	#define LOG_BEGIN(message) Logger::EnterFunction(_L8(message))
	#define LOG_END(message) Logger::LeaveFunction(_L8(message))

	#define LOG_WRITE(message) Logger::AddLineF(_L8(message))
	#define LOG_WRITED(message) Logger::AddLineF(message)
	#define LOG_FORMAT Logger::AddLineF
#else
	#define LOG_FORMAT //
	#define LOG_CLEAR //
	#define LOG_BEGIN //
	#define LOG_END //
	#define LOG_WRITE //
	#define LOG_WRITED //
#endif

#endif
